<!doctype html>
<html class="default no-js">
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>Laya | ts</title>
	<meta name="description" content="Documentation for ts">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="stylesheet" href="../assets/css/main.css">
</head>
<body>
<header>
	<div class="tsd-page-toolbar">
		<div class="container">
			<div class="table-wrap">
				<div class="table-cell" id="tsd-search" data-index="../assets/js/search.json" data-base="..">
					<div class="field">
						<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
						<input id="tsd-search-field" type="text" />
					</div>
					<ul class="results">
						<li class="state loading">Preparing search index...</li>
						<li class="state failure">The search index is not available</li>
					</ul>
					<a href="../index.html" class="title">ts</a>
				</div>
				<div class="table-cell" id="tsd-widgets">
					<div id="tsd-filter">
						<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
						<div class="tsd-filter-group">
							<div class="tsd-select" id="tsd-filter-visibility">
								<span class="tsd-select-label">All</span>
								<ul class="tsd-select-list">
									<li data-value="public">Public</li>
									<li data-value="protected">Public/Protected</li>
									<li data-value="private" class="selected">All</li>
								</ul>
							</div>
							<input type="checkbox" id="tsd-filter-inherited" checked />
							<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
							<input type="checkbox" id="tsd-filter-externals" checked />
							<label class="tsd-widget" for="tsd-filter-externals">Externals</label>
							<input type="checkbox" id="tsd-filter-only-exported" />
							<label class="tsd-widget" for="tsd-filter-only-exported">Only exported</label>
						</div>
					</div>
					<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
				</div>
			</div>
		</div>
	</div>
	<div class="tsd-page-title">
		<div class="container">
			<ul class="tsd-breadcrumb">
				<li>
					<a href="../globals.html">Globals</a>
				</li>
				<li>
					<a href="../modules/_laya_.html">&quot;Laya&quot;</a>
				</li>
				<li>
					<a href="_laya_.laya.html">Laya</a>
				</li>
			</ul>
			<h1>Class Laya</h1>
		</div>
	</div>
</header>
<div class="container container-main">
	<div class="row">
		<div class="col-8 col-content">
			<section class="tsd-panel tsd-comment">
				<div class="tsd-comment tsd-typography">
					<div class="lead">
						<p><code>Laya</code> 是全局对象的引用入口集。
						Laya类引用了一些常用的全局对象，比如Laya.stage：舞台，Laya.timer：时间管理器，Laya.loader：加载管理器，使用时注意大小写。</p>
					</div>
				</div>
			</section>
			<section class="tsd-panel tsd-hierarchy">
				<h3>Hierarchy</h3>
				<ul class="tsd-hierarchy">
					<li>
						<span class="target">Laya</span>
					</li>
				</ul>
			</section>
			<section class="tsd-panel-group tsd-index-group">
				<h2>Index</h2>
				<section class="tsd-panel tsd-index-panel">
					<div class="tsd-index-content">
						<section class="tsd-index-section ">
							<h3>Properties</h3>
							<ul class="tsd-index-list">
								<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><a href="_laya_.laya.html#iswxopendatacontext" class="tsd-kind-icon">isWXOpen<wbr>Data<wbr>Context</a></li>
								<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><a href="_laya_.laya.html#iswxposmsg" class="tsd-kind-icon">isWXPos<wbr>Msg</a></li>
								<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><a href="_laya_.laya.html#loader" class="tsd-kind-icon">loader</a></li>
								<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><a href="_laya_.laya.html#stage" class="tsd-kind-icon">stage</a></li>
								<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><a href="_laya_.laya.html#timer" class="tsd-kind-icon">timer</a></li>
								<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><a href="_laya_.laya.html#version" class="tsd-kind-icon">version</a></li>
							</ul>
						</section>
						<section class="tsd-index-section ">
							<h3>Methods</h3>
							<ul class="tsd-index-list">
								<li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><a href="_laya_.laya.html#__init" class="tsd-kind-icon">__init</a></li>
								<li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><a href="_laya_.laya.html#alertglobalerror" class="tsd-kind-icon">alert<wbr>Global<wbr>Error</a></li>
								<li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><a href="_laya_.laya.html#enabledebugpanel" class="tsd-kind-icon">enable<wbr>Debug<wbr>Panel</a></li>
								<li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><a href="_laya_.laya.html#init" class="tsd-kind-icon">init</a></li>
							</ul>
						</section>
					</div>
				</section>
			</section>
			<section class="tsd-panel-group tsd-member-group ">
				<h2>Properties</h2>
				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-static">
					<a name="iswxopendatacontext" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagStatic">Static</span> isWXOpen<wbr>Data<wbr>Context</h3>
					<div class="tsd-signature tsd-kind-icon">isWXOpen<wbr>Data<wbr>Context<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = false</span></div>
					<aside class="tsd-sources">
						<ul>
							<li>Defined in Laya.ts:99</li>
						</ul>
					</aside>
					<div class="tsd-comment tsd-typography">
						<div class="lead">
							<p>是否是微信小游戏子域，默认为false</p>
						</div>
					</div>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-static">
					<a name="iswxposmsg" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagStatic">Static</span> isWXPos<wbr>Msg</h3>
					<div class="tsd-signature tsd-kind-icon">isWXPos<wbr>Msg<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = false</span></div>
					<aside class="tsd-sources">
						<ul>
							<li>Defined in Laya.ts:101</li>
						</ul>
					</aside>
					<div class="tsd-comment tsd-typography">
						<div class="lead">
							<p>微信小游戏是否需要在主域中自动将加载的文本数据自动传递到子域，默认 false</p>
						</div>
					</div>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-static">
					<a name="loader" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagStatic">Static</span> loader</h3>
					<div class="tsd-signature tsd-kind-icon">loader<span class="tsd-signature-symbol">:</span> <a href="_laya_net_loadermanager_.loadermanager.html" class="tsd-signature-type">LoaderManager</a><span class="tsd-signature-symbol"> = null</span></div>
					<aside class="tsd-sources">
						<ul>
							<li>Defined in Laya.ts:89</li>
						</ul>
					</aside>
					<div class="tsd-comment tsd-typography">
						<div class="lead">
							<p>加载管理器的引用。</p>
						</div>
					</div>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-static">
					<a name="stage" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagStatic">Static</span> stage</h3>
					<div class="tsd-signature tsd-kind-icon">stage<span class="tsd-signature-symbol">:</span> <a href="_laya_display_stage_.stage.html" class="tsd-signature-type">Stage</a><span class="tsd-signature-symbol"> = null</span></div>
					<aside class="tsd-sources">
						<ul>
							<li>Defined in Laya.ts:74</li>
						</ul>
					</aside>
					<div class="tsd-comment tsd-typography">
						<div class="lead">
							<p>舞台对象的引用。</p>
						</div>
					</div>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-static">
					<a name="timer" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagStatic">Static</span> timer</h3>
					<div class="tsd-signature tsd-kind-icon">timer<span class="tsd-signature-symbol">:</span> <a href="_laya_utils_timer_.timer.html" class="tsd-signature-type">Timer</a><span class="tsd-signature-symbol"> = null</span></div>
					<aside class="tsd-sources">
						<ul>
							<li>Defined in Laya.ts:87</li>
						</ul>
					</aside>
					<div class="tsd-comment tsd-typography">
						<div class="lead">
							<p>游戏主时针，同时也是管理场景，动画，缓动等效果时钟，通过控制本时针缩放，达到快进慢播效果</p>
						</div>
					</div>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-static">
					<a name="version" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagStatic">Static</span> version</h3>
					<div class="tsd-signature tsd-kind-icon">version<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = &quot;2.10.0beta&quot;</span></div>
					<aside class="tsd-sources">
						<ul>
							<li>Defined in Laya.ts:92</li>
						</ul>
					</aside>
					<div class="tsd-comment tsd-typography">
						<div class="lead">
							<p>当前引擎版本。</p>
						</div>
					</div>
				</section>
			</section>
			<section class="tsd-panel-group tsd-member-group ">
				<h2>Methods</h2>
				<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-static">
					<a name="__init" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagStatic">Static</span> __init</h3>
					<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-static">
						<li class="tsd-signature tsd-kind-icon">__init<span class="tsd-signature-symbol">(</span>_classs<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
					</ul>
					<ul class="tsd-descriptions">
						<li class="tsd-description">
							<aside class="tsd-sources">
								<ul>
									<li>Defined in Laya.ts:156</li>
								</ul>
							</aside>
							<div class="tsd-comment tsd-typography">
								<div class="lead">
									<p>兼容as3编译工具</p>
								</div>
							</div>
							<h4 class="tsd-parameters-title">Parameters</h4>
							<ul class="tsd-parameters">
								<li>
									<h5>_classs: <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></h5>
								</li>
							</ul>
							<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
						</li>
					</ul>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-static">
					<a name="alertglobalerror" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagStatic">Static</span> alert<wbr>Global<wbr>Error</h3>
					<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-static">
						<li class="tsd-signature tsd-kind-icon">alert<wbr>Global<wbr>Error<span class="tsd-signature-symbol">(</span>value<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
					</ul>
					<ul class="tsd-descriptions">
						<li class="tsd-description">
							<aside class="tsd-sources">
								<ul>
									<li>Defined in Laya.ts:279</li>
								</ul>
							</aside>
							<div class="tsd-comment tsd-typography">
								<div class="lead">
									<p>表示是否捕获全局错误并弹出提示。默认为false。
									适用于移动设备等不方便调试的时候，设置为true后，如有未知错误，可以弹窗抛出详细错误堆栈。</p>
								</div>
							</div>
							<h4 class="tsd-parameters-title">Parameters</h4>
							<ul class="tsd-parameters">
								<li>
									<h5>value: <span class="tsd-signature-type">boolean</span></h5>
								</li>
							</ul>
							<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
						</li>
					</ul>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-static">
					<a name="enabledebugpanel" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagStatic">Static</span> enable<wbr>Debug<wbr>Panel</h3>
					<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-static">
						<li class="tsd-signature tsd-kind-icon">enable<wbr>Debug<wbr>Panel<span class="tsd-signature-symbol">(</span>debugJsPath<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
					</ul>
					<ul class="tsd-descriptions">
						<li class="tsd-description">
							<aside class="tsd-sources">
								<ul>
									<li>Defined in Laya.ts:302</li>
								</ul>
							</aside>
							<div class="tsd-comment tsd-typography">
								<div class="lead">
									<p>开启DebugPanel</p>
								</div>
							</div>
							<h4 class="tsd-parameters-title">Parameters</h4>
							<ul class="tsd-parameters">
								<li>
									<h5><span class="tsd-flag ts-flagDefault value">Default value</span> debugJsPath: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = &quot;libs/laya.debugtool.js&quot;</span></h5>
									<div class="tsd-comment tsd-typography">
										<p>laya.debugtool.js文件路径</p>
									</div>
								</li>
							</ul>
							<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
						</li>
					</ul>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-static">
					<a name="init" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagStatic">Static</span> init</h3>
					<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-static">
						<li class="tsd-signature tsd-kind-icon">init<span class="tsd-signature-symbol">(</span>width<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, height<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, <span class="tsd-signature-symbol">...</span>plugins<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span></li>
					</ul>
					<ul class="tsd-descriptions">
						<li class="tsd-description">
							<aside class="tsd-sources">
								<ul>
									<li>Defined in Laya.ts:167</li>
								</ul>
							</aside>
							<div class="tsd-comment tsd-typography">
								<div class="lead">
									<p>初始化引擎。使用引擎需要先初始化引擎，否则可能会报错。</p>
								</div>
							</div>
							<h4 class="tsd-parameters-title">Parameters</h4>
							<ul class="tsd-parameters">
								<li>
									<h5>width: <span class="tsd-signature-type">number</span></h5>
									<div class="tsd-comment tsd-typography">
										<p>初始化的游戏窗口宽度，又称设计宽度。</p>
									</div>
								</li>
								<li>
									<h5>height: <span class="tsd-signature-type">number</span></h5>
									<div class="tsd-comment tsd-typography">
										<p>初始化的游戏窗口高度，又称设计高度。</p>
									</div>
								</li>
								<li>
									<h5><span class="tsd-flag ts-flagRest">Rest</span> <span class="tsd-signature-symbol">...</span>plugins: <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></h5>
									<div class="tsd-comment tsd-typography">
										<p>插件列表，比如 WebGL（使用WebGL方式渲染）。</p>
									</div>
								</li>
							</ul>
							<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span></h4>
							<p>返回原生canvas引用，方便对canvas属性进行修改</p>
						</li>
					</ul>
				</section>
			</section>
		</div>
		<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
			<nav class="tsd-navigation primary">
				<ul>
					<li class="globals  ">
						<a href="../globals.html"><em>Globals</em></a>
					</li>
					<li class="current tsd-kind-module">
						<a href="../modules/_laya_.html">&quot;<wbr>Laya&quot;</a>
					</li>
				</ul>
			</nav>
			<nav class="tsd-navigation secondary menu-sticky">
				<ul class="before-current">
				</ul>
				<ul class="current">
					<li class="current tsd-kind-class tsd-parent-kind-module">
						<a href="_laya_.laya.html" class="tsd-kind-icon">Laya</a>
						<ul>
							<li class=" tsd-kind-property tsd-parent-kind-class tsd-is-static">
								<a href="_laya_.laya.html#iswxopendatacontext" class="tsd-kind-icon">isWXOpen<wbr>Data<wbr>Context</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-class tsd-is-static">
								<a href="_laya_.laya.html#iswxposmsg" class="tsd-kind-icon">isWXPos<wbr>Msg</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-class tsd-is-static">
								<a href="_laya_.laya.html#loader" class="tsd-kind-icon">loader</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-class tsd-is-static">
								<a href="_laya_.laya.html#stage" class="tsd-kind-icon">stage</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-class tsd-is-static">
								<a href="_laya_.laya.html#timer" class="tsd-kind-icon">timer</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-class tsd-is-static">
								<a href="_laya_.laya.html#version" class="tsd-kind-icon">version</a>
							</li>
							<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-static">
								<a href="_laya_.laya.html#__init" class="tsd-kind-icon">__init</a>
							</li>
							<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-static">
								<a href="_laya_.laya.html#alertglobalerror" class="tsd-kind-icon">alert<wbr>Global<wbr>Error</a>
							</li>
							<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-static">
								<a href="_laya_.laya.html#enabledebugpanel" class="tsd-kind-icon">enable<wbr>Debug<wbr>Panel</a>
							</li>
							<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-static">
								<a href="_laya_.laya.html#init" class="tsd-kind-icon">init</a>
							</li>
						</ul>
					</li>
				</ul>
				<ul class="after-current">
					<li class=" tsd-kind-variable tsd-parent-kind-module tsd-is-not-exported">
						<a href="../modules/_laya_.html#libs" class="tsd-kind-icon">libs</a>
					</li>
					<li class=" tsd-kind-variable tsd-parent-kind-module tsd-is-not-exported">
						<a href="../modules/_laya_.html#win" class="tsd-kind-icon">win</a>
					</li>
					<li class=" tsd-kind-function tsd-parent-kind-module">
						<a href="../modules/_laya_.html#_static" class="tsd-kind-icon">_static</a>
					</li>
				</ul>
			</nav>
		</div>
	</div>
</div>
<footer>
	<div class="container">
		<h2>Legend</h2>
		<div class="tsd-legend-group">
			<ul class="tsd-legend">
				<li class="tsd-kind-variable"><span class="tsd-kind-icon">Variable</span></li>
				<li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li>
			</ul>
			<ul class="tsd-legend">
				<li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li>
				<li class="tsd-kind-class tsd-has-type-parameter"><span class="tsd-kind-icon">Class with type parameter</span></li>
			</ul>
			<ul class="tsd-legend">
				<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li>
				<li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static method</span></li>
			</ul>
			<ul class="tsd-legend">
				<li class="tsd-kind-enum"><span class="tsd-kind-icon">Enumeration</span></li>
			</ul>
			<ul class="tsd-legend">
				<li class="tsd-kind-interface"><span class="tsd-kind-icon">Interface</span></li>
			</ul>
		</div>
	</div>
</footer>
<div class="overlay"></div>
<script src="../assets/js/main.js"></script>
</body>
</html>